from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from users import views

urlpatterns = [
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.RegisterUsernameView.as_view(), name='usernamecount'),
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$', views.RegisterUsermobileView.as_view(), name='phonecount'),
    url(r'^$', views.RegisterCreateView.as_view()),
    url(r'^infos/$', views.UserInfoDetailView.as_view()),
    url(r'^emails/$', views.SendMailView.as_view()),
    url(r'^emails/verification/$', views.VerificationMailView.as_view()),
    url(r'^browerhistories/$', views.UserBrowerHistoryView.as_view()),
    url(r'auths/', views.UserAuthorizationView.as_view(), name='auths'),

]

from .views import UserAddrView
from rest_framework.routers import DefaultRouter

router = DefaultRouter()
router.register(r'addresses', UserAddrView, base_name='')
urlpatterns += router.urls
